<script setup>
    import layoutSlot from '@/components/layoutSlot.vue'
    import { notGetnoticeInfoService } from '@/api/notice.js'
    import { ref } from 'vue';

    // 公告的数据
    const noticeValue = ref([])

    // 获取公告数据
    const getNotice = async() => {
        const {data} = await notGetnoticeInfoService()
            noticeValue.value = data.data
            console.log(noticeValue.value);
    }
    getNotice()
</script>

<template>
    <div class="notice-box">
        <div class="notice-item" v-for="item in noticeValue">
            <div class="title">{{ item.title }}</div>
            <div class="content"><el-input type="textarea" v-model="item.content" disabled></el-input></div>
            <div class="date">{{ item.date }}</div>
        </div>
    </div>
</template>

<style scoped lang="scss">
    .notice-box {
        height: 87vh;
        overflow: auto;
        padding: 0 40px 0 40px;
    }
    .notice-item {
        margin-bottom: 20px;
        background-color: #f5f7fa;
        padding: 20px;
        .title {
            color: #f87a8f;
            font-weight: bold;
        }
        .content {
            margin: 10px 0 10px 0;
            line-height: 30px;
        }
        .date {
            font-size: 12px;
            color: #747474;
            margin-left: 90%;
        }
    }


</style>